-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace ShippingMethod#display_on with ShippingMethod#available_to_users #1611
Replace ShippingMethod#display_on with ShippingMethod#available_to_users #1611
Conversation
This replaces ShippingMethod#display_on with ShippingMethod#available_to_users to match a similar change made to payment methods. Unlike with payment_methods, this doesn't add an #available_to_admin column, because the existing functionality did not provide a way to hide shipping methods from admins. Having display_on="front_end" was identical to having display_on="both" (or actually any string other than "back_end").
e835cef
to
58ab9eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and makes more sense, thanks.
Can we deprecate constants? Spree::ShippingMethod::DISPLAY
isn't used anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
There is this DeprecatedConstantProxy, although I doubt that anybody ever used this constant and it's safe to be used removed.
What's best here is probably to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ActiveSupport is just awesome
Echoing the work done in #1540 to PaymentMethods
This replaces
ShippingMethod#display_on
withShippingMethod#available_to_users
.Unlike with payment_methods, this doesn't add an
#available_to_admin
column, because the existing functionality did not provide a way to hide shipping methods from admins. Havingdisplay_on="front_end"
was identical to havingdisplay_on="both"
(or actually any string other than"back_end"
).